import axios, { AxiosRequestConfig } from 'axios'
const RES_OK = 0
// interface ParamsProp {
//     [propkey: string]: any;
// }
interface DateProp {
    code: number;
    result: any;
    [propkey: string]: any;
}

axios.defaults.baseURL = '/'
export const get = (url: string, config?: AxiosRequestConfig): Promise<any> => {
    return axios.get(url, config)
        .then(res => {
            const { code, result } = res.data
            if (code === RES_OK) {
                return result
            }
        })
        .catch(e => {
            console.log(e)
        })
}
